package top.likeqc.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.likeqc.blog.dao.UserRepository;
import top.likeqc.blog.pojo.User;
import top.likeqc.blog.service.UserService;
import top.likeqc.blog.util.MD5Utlils;

/**
 * @author likeqc.top
 * @date 2021/4/16 14:08
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utlils.code(password));
        return user;
    }
}
